package com.itheima.apidemo;

import java.util.Arrays;

public class Demo10 {

    public static void main(String[] args) {
        int[] arr = {19, 82, 37, 64, 55};
      /*  int number=100;
        int index=-1;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]==number){
                System.out.println(i);
                break;
            }
        }
        if(index==-1){
            System.out.println("不存在");
        }*/
        Arrays.sort(arr);
        //{19,37,55,64,82}
        int i = Arrays.binarySearch(arr, 44);//-5-1  负插入点-1
        System.out.println(i);

    }
}
